/**
 * 提示类
 */

class Prompt extends Laya.Label {
    private hideY = 0;  //提示文字消失时的y坐标

    constructor() {
        super();
        this.anchorX = 0.5;
	    this.anchorY = 0.5;
        this.align = "center";
        this.color = "#000000";
        this.font = "Microsoft YaHei";
        this.fontSize = 34;
        this.width = 0;
        this.height = 0;
        this.hideY = Math.floor(Laya.stage.height / 5);
    }

    Show(strContent:string) {
        this.x = Math.floor(Laya.stage.width / 2);
        this.y = Math.floor(Laya.stage.height / 2);
        this.alpha = 1;
        this.text = strContent;
        Game.layerPrompt.addChild(this);
        Laya.Tween.to(this, {y:this.hideY,alpha:0.4}, 3000, null, Laya.Handler.create(Game.viewFarm,Game.viewFarm.PromptEnd,[this]), 500);
    }
}